package com.jiantong.lawEnforcing.impl.dao;

import com.jiantong.lawEnforcing.model.Datas;
import io.terminus.common.mysql.dao.MyBatisDao;
import org.springframework.stereotype.Repository;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * 存储表
 * Created by mz03 on 2017/8/14.
 */
@Repository
public class DatasDao extends MyBatisDao<Datas> {
    /***
     * 根据案件id 和 originIds 查询一组数据; 可以查询指定案件下的一种文书的全部内容
     * @param map
     * @return
     */
    public List<Datas> findByOriginIds(Map<String,Object> map) {
        if (map.size()==0){
            return Collections.emptyList();
        }
        return this.sqlSession.selectList(this.sqlId("findByOriginIds"), map);
    }

 public List<Datas> findDataList(Map<String,Object> map) {
        if (map.size()==0){
            return Collections.emptyList();
        }
        return this.sqlSession.selectList(this.sqlId("findDataList"), map);
    }



    public Integer deletesByOriginIds(Map<String,Object> criteria) {
        return Integer.valueOf(this.sqlSession.delete(this.sqlId("deletesByOriginIds"), criteria));
    }


    public Integer findDatasCount(Map<String,Object> criteria) {
        return this.sqlSession.selectOne(this.sqlId("findDatasCount"), criteria);
    }

}
